<extend name="Public/common" />
<block name="body">
  <script type="text/javascript" src="__JS__/jquery-ui/jquery.ui.js"></script>
  <script type="text/javascript" src="__JS__/jquery-ui/i18n/zh-CN.js" charset="utf-8"></script>
  <link rel="stylesheet" type="text/css" href="__JS__/jquery-ui/themes/ui-lightness/jquery.ui.css"  />
  <div class="page">
    <div class="fixed-bar">
      <div class="item-title">
        <h3>优惠券发送</h3>
        <ul class="tab-base">
          <li><a href="{:U('index')}"><span>列表</span></a></li>
        </ul>
      </div>
    </div>
    <div class="fixed-empty"></div>
    <form id="form1" method="post" enctype="multipart/form-data" name="form1">
      <table class="table tb-type2">
        <tbody>
        <tr class="noborder">
          <td colspan="2" class="required"><label class="validation" for="coupon_id">优惠券:</label></td>
        </tr>
        <tr class="noborder">
          <td class="vatop rowform"> <select class="querySelect" name="coupon_id">
            <option value="">请选择...</option>
            <notempty name="coupon">
              <volist name="coupon" id="vo">
                <option <eq name="coupon_id" value="$vo.coupon_id">selected='selected'</eq> value="{$vo.coupon_id}">{$vo.coupon_name}</option>
              </volist>
            </notempty>
          </select></td>
          <td class="vatop tips">选择优惠券</td>
        </tr>

        <tr>
          <td colspan="2" class="required"><label class="validation" for="member_id">会员ID:</label></td>
        </tr>
        <tr class="noborder">
          <td class="vatop rowform"><textarea name="member_id" rows="6" class="tarea" id="member_id"></textarea></td>
          <td class="vatop tips"><span class="vatop rowform">多个会员ID 用,号隔开，一次建议不超过1000个</span></td>
        </tr>
        </tbody>
        <tfoot>
        <tr class="tfoot">
          <td colspan="15" ><a href="JavaScript:void(0);" class="btn" id="submit"><span>提交</span></a></td>
        </tr>
        </tfoot>
      </table>
    </form>
  </div>
  <script type="text/javascript" src="__JS__/fileupload/jquery.iframe-transport.js" charset="utf-8"></script>
  <script type="text/javascript" src="__JS__/fileupload/jquery.ui.widget.js" charset="utf-8"></script>
  <script type="text/javascript" src="__JS__/fileupload/jquery.fileupload.js" charset="utf-8"></script>
  <script type="text/javascript">
      $(document).ready(function(){
          $('#form1').validate({
              errorPlacement: function(error, element){
                  error.appendTo(element.parent().parent().prev().find('td:first'));
              },
              rules : {
                  coupon_id : {
                      required : true
                  },
                  member_id : {
                      required : true
                  }
              },
              messages : {
                  coupon_id : {
                      required : "必须选择优惠券"
                  },
                  member_id : {
                      required : "会员ID必须填写"
                  }
              }
          });
          $("#submit").click(function() {
              if ($("#form1").valid()) {
                  $("#form1").submit();
              }
          });
      });
  </script>
</block>